﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quartz;
using ZHDJ.Core.Log;

namespace ZHDJ.WinService.Util
{
    public class JobBase : IJob
    {

        public JobBase()
        {
            
        }

        public virtual JobSetInfo JobSetInfo { get; }
        
        public  void Execute(IJobExecutionContext context)
        {
            try
            {
                RunBusiness(context);
            }
            catch (Exception ex)
            {

                LogHelper.Error(ex);
            }
        }

        public virtual void RunBusiness(IJobExecutionContext context)
        {

        }

        /// <summary>
        /// 服务停止
        /// </summary>
        public virtual void OnStop()
        {

        }

        /// <summary>
        /// 服务开始
        /// </summary>
        public virtual void OnStart()
        {

        }
    }
}
